import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '姓名',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '试卷名称',
    align: "center",
    dataIndex: 'source'
  },
  {
    title: '考试时间',
    align: "center",
    dataIndex: 'examDate'
  },
  {
    title: '试卷总分',
    align: "center",
    dataIndex: 'totalScore'
  },
  {
    title: '分数',
    align: "center",
    dataIndex: 'score'
  },
  {
    title: '是否及格',
    align: "center",
    dataIndex: 'isPass'
  },
  {
    title: '判断题数目',
    align: "center",
    dataIndex: 'judgeQuestionNumber'
  },
  {
    title: '选择题数目',
    align: "center",
    dataIndex: 'mutilQuestionNumber'
  },
  {
    title: '填空题数目',
    align: "center",
    dataIndex: 'fillQuestionNumber'
  },
  {
    title: '试卷id',
    align: "center",
    dataIndex: 'paperid'
  },
  {
    title: '判断题答案',
    align: "center",
    dataIndex: 'judgeQuestionAnswer'
  },
  {
    title: '选择题答案',
    align: "center",
    dataIndex: 'mutilQuestionAnswer'
  },
  {
    title: '填空题答案',
    align: "center",
    dataIndex: 'fillQuestionAnswer'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "姓名",
    field: 'name',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "试卷名称",
    field: 'source',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "考试时间",
    field: "examDate",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "是否及格",
    field: 'isPass',
    component: 'Input',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '姓名',
    field: 'name',
    component: 'Input',
  },
  {
    label: '试卷名称',
    field: 'source',
    component: 'Input',
  },
  {
    label: '考试时间',
    field: 'examDate',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '试卷总分',
    field: 'totalScore',
    component: 'InputNumber',
  },
  {
    label: '分数',
    field: 'score',
    component: 'InputNumber',
  },
  {
    label: '是否及格',
    field: 'isPass',
    component: 'InputNumber',
  },
  {
    label: '判断题数目',
    field: 'judgeQuestionNumber',
    component: 'InputNumber',
  },
  {
    label: '选择题数目',
    field: 'mutilQuestionNumber',
    component: 'InputNumber',
  },
  {
    label: '填空题数目',
    field: 'fillQuestionNumber',
    component: 'InputNumber',
  },
  {
    label: '试卷id',
    field: 'paperid',
    component: 'Input',
  },
  {
    label: '判断题答案',
    field: 'judgeQuestionAnswer',
    component: 'Input',
  },
  {
    label: '选择题答案',
    field: 'mutilQuestionAnswer',
    component: 'Input',
  },
  {
    label: '填空题答案',
    field: 'fillQuestionAnswer',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
